home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / apps / 63 / applic / addition.bas next >
Encoding:
BASIC Source File  |  1986-10-16  |  2.0 KB  |  78 lines

  1. 1     rem Addition practice for children, various levels of
  2. 2     rem difficulty.  Hit return or "y" return to keep on
  3. 3     rem playing. "n" return ends program.
  4. 4     rem by Dan Stubbs, Minnesota, member of MAST and STING
  5. 5     bit=0
  6. 10    fullw 2: clearw 2
  7. 20    a=10: gosub setheight
  8. 30    color 2,0,1
  9. 40    gotoxy 20,1: ? "Addition Magician - At Your Service"
  10. 50    color 1,0,1
  11. 60    if bit=1 goto 130
  12. 70    a=9 :gosub setheight
  13. 80    ? "Difficulty level 1 to 10"
  14. 90    input dif
  15. 100   level=dif*5
  16. 110   randomize peek(&h4bc)
  17. 120   bit=1
  18. 130   gotoxy 27,5
  19. 140   x1=int(rnd*level)
  20. 150   a=15 :gosub setheight
  21. 160   ? " "x1
  22. 170   gotoxy 27,8
  23. 180   y1=int(rnd*level)
  24. 190   ? "+"y1
  25. 200   gotoxy 27,10
  26. 210   correct = x1+y1
  27. 220   ? " --"
  28. 230   gotoxy 27,12
  29. 240   input ans
  30. 250   if ans=correct then gotoxy 29,12:? ans "is correct":goto 310
  31. 260   gotoxy 0,13
  32. 270   ? "Try again"
  33. 280   gosub drawsad
  34. 290   goto 230
  35. 300   gotoxy 2,18
  36. 310   gosub drawhappy
  37. 320   numr=numr+1
  38. 330   gotoxy 25,16:? numr "correct problems"
  39. 340   gotoxy 0,13
  40. 350   ?"Another problem  (Y)": gotoxy 20,13
  41. 360   input rep$
  42. 370   if((rep$="n")or(rep$="N")) then goto 380 else goto 10
  43. 380   a=9: gosub setheight
  44. 390   end
  45. 400   setheight:
  46. 410   poke contrl  ,107
  47. 420   poke contrl+2,0
  48. 430   poke contrl+6,1
  49. 440   poke intin   ,a
  50. 450   vdisys
  51. 460   return
  52. 470   drawsad:
  53. 480   x=100:y=50:r=30
  54. 490   circle x,y,r
  55. 500   x1=x-.4*r:y1=y-.2*r:r1=r/6
  56. 510   circle x1,y1,r1
  57. 520   x2=x+.4*r
  58. 530   circle x2,y1,r1
  59. 540   color 1,3,1
  60. 550   pcircle x,y+.0*r,r/5
  61. 560   circle x,y+.3*r,r/4,0,1800
  62. 562   sound 1,8,8,5,15: sound 1,8,8,1,25:sound 1,0,0,0,0
  63. 570   return
  64. 580   drawhappy:
  65. 590   x=100:y=50:r=30
  66. 600   circle x,y,r
  67. 610   x1=x-.4*r:y1=y-.2*r:r1=r/6
  68. 620   circle x1,y1,r1
  69. 630   x2=x+.4*r
  70. 640   circle x2,y1,r1
  71. 650   color 1,2,1
  72. 660   pcircle x,y+.0*r,r/5
  73. 670   circle x,y+.2*r,r/4,1800,3600
  74. 672   sound 1,8,8,4,15:sound 1,8,10,4,15:sound 1,8,12,4,15
  75. 674   sound 1,8,6,5,10:sound 1,0,0,0,5: sound 1,8,6,5,10
  76. 676   sound 1,0,0,0,0
  77. 680   return
  78. ə